package com.hzit.user.client;

import com.hzit.common.R;
import com.hzit.user.to.BrandTo;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestHeader;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@Component
public class ManagerClientFactoryImpl implements FallbackFactory<ManagerClient> {
	@Override
	public ManagerClient create(Throwable cause) {
		return new ManagerClient() {
			@Override
			public R findAll(String s) {
				return R.error("(fallbakcFactory)对不起，不能访问hzit-manager服务--->findAll()!");
			}

			@Override
			public R findById(Long id) {
				return R.error("(fallbakcFactory)对不起，不能访问hzit-manager服务--->findById()!");
			}

			@Override
			public R add(BrandTo brand) {
				return R.error("(fallbakcFactory)对不起，不能访问hzit-manager服务--->add()!");
			}
		};
	}
}
